package co.yixiang.modules.shop.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.sql.Date;
import java.time.LocalDateTime;

/**
* @author lijunze
* @date 2020-04-28
*/
@Entity
@Data
@Table(name="product_brand")
public class ProductBrand implements Serializable {

    /** id */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty("id")
    private Integer id;

    /** 品牌名称 */
    @Column(name = "name")
    @ApiModelProperty("品牌名称")
    private String name;

    /** 品牌描述 */
    @Column(name = "description")
    @ApiModelProperty("商品价格")
    private String description;

    /** 品牌图片 */
    @Column(name = "image")
    @ApiModelProperty("品牌图片")
    private String image;

    /** 删除状态,0未删除，1已删除 */
    @Column(name = "is_del")
    @ApiModelProperty("删除状态,0未删除，1已删除")
    private String isDel;

    /** 创建时间 */
    @Column(name = "create_time")
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    /** 排序 */
    @Column(name = "sort")
    @ApiModelProperty("排序")
    private Integer sort;

    /** 首字母 */
    @Column(name = "initial")
    @ApiModelProperty("首字母")
    private String initial;

    public void copy(ProductBrand source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}